{extend name="public/base" /}
{block name="container"}
<div class="panel panel-default">
  <div class="panel-heading">
    <h4 class="panel-title">添加用户组</h4>
  </div>
  <div class="panel-body panel-body-nopadding">

    <form class="form-horizontal form-bordered" id="submitForm" action="" method="post" >
      <div class="form-group">
        <label class="col-sm-3 control-label">用户组名称:</label>
        <div class="col-sm-6">
          <input type="text" class="form-control" name="title" placeholder="请输入用户名"  value="{$data.title ?? ''}"  >
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">描&emsp;&emsp;述：</label>
        <div class="col-sm-6">
          <textarea class="form-control" placeholder="" name="description">{$data.description ?? ''}</textarea>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">状&emsp;&emsp;态：</label>
        <div class="col-sm-6 wh-inline">
          <div class="rdio rdio-primary">
            <?php if(empty($data['status'])){?>
            <input type="radio" name="status" id="status-1" value="1" >启用
            <input type="radio" name="status" id="status-2" value="0">禁用
          <?php }else{?>
          <input type="radio" name="status" id="status-1" value="1" {if condition="$data.status eq 1"} checked="checked"{/if}>启用
          <input type="radio" name="status" id="status-2" value="0" {if condition="$data.status eq 0"} checked="checked"{/if}>禁用
          <?php }?>
          </div>
        </div>
      </div>


      <div class="panel-footer">
       <div class="row">
        <div class="col-sm-6 col-sm-offset-3">
          <input type="hidden" name="id" value="{$data.id ?? ''}">
          <button type="submit" class="btn btn-primary">提交</button>
          <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);">返回</button>
        </div>
      </div>
    </div><!-- panel-footer -->

  </form>
</div>
{/block}
{block name="js"}
<script>
 document.ready(function() {
  jquery.("[name='status'][value='{$data.status ?? '1'}']").attr("checked", true);
});
</script>
{/block}